CNC Control Systems
The purpose of a CNC machine is to use a set of input specifications describing a physical object to produce a machined part according to the specifications. The part is typically formed from solid block stock material such as metal, and shaped by various machine tools such as drills, mills, lathes, electrostatic discharge machines (EDMs), gauging systems and the like. CNC machines are complex and include hundreds of components. Examples of input devices include keyboards, operator consoles, pressure sensitive CRTs, various tools and machine sensors, limit switches and network interfaces. Output devices include motion controllers that send motion control signals to motors driving axes or a tool, CRT displays, console status lights and audible alarms. Other components include microprocessors, memory, disk drives, data buses and wiring harnesses. The software executed by the computer processor is a critical component of a CNC machine, as it coordinates the functions of the all the other components of the system. In general, CNC software is custom written for the particular brand of components a CNC manufacturer or system integrator chooses to include in the CNC machine. As a result, CNC software is extremely complex, and a software programmer for a particular CNC machine must be intimately familiar with the way virtually every hardware component interfaces with the software, and with the entire software system itself.
For example, two representative functions of most CNC software are the logic and motion control functions (collectively referred to herein as the "kernel"). The logic control function keeps track of the specific sequence of steps that must be taken by various movable hardware components to accomplish a task. For example, the steps required to mount a differently sized drill bit into the tool holder of a spindle from an automatic tool changer in a milling application might be: (1) send a command to raise the spindle containing the currently mounted drill bit so the tool changer will fit underneath it, (2) send a command to the tool changer instructing it to move below the spindle, (3) send a command to the spindle instructing it to release the currently mounted drill bit, (4) wait for a signal from the spindle indicating that the drill bit has been released, (5) send a command to the tool changer instructing it to move to rotate clockwise 30 degrees to position the new drill bit below the spindle, (6) interrogate the tool changer to confirm that the tool changer has successfully executed the rotation command, (7) send a command to the spindle commanding it to engage the new drill bit underneath it in the tool changer, and (8) send a command to the tool changer instructing it move away from the spindle and work area. Given the hundreds of moving, controllable parts in a CNC machine tool, the logic control function is much more complex than the above simplified example illustrates.
The motion control function of the software receives commands describing how a particular axis or motor should be moved. For example, in the above example for logic control, the logic control function sent the motion control function a command to raise the spindle. The motion control function takes this "general" command, breaks it down into smaller, discrete movements (i.e. controllably move the spindle up 0.001" at a time until it has moved up a total of 6 inches), and sends and receive electric signals from precision motors to ensure the movement is carried out. The motion control function is also able to execute more complex, multi-dimensional commands, such as to move the axes of a milling machine in a pattern so as to cut an ellipse of specified dimensions in a workpiece.
Because the motion control function is the portion of the software (except for device drivers) that interacts most closely with the hardware components that actually carry out shaping processes on a workpiece, the motion control function also receives information about hardware faults from hardware devices. For example, if a hardware device is unable to execute an instruction, the motion control function will receive a notice of the error from the hardware (or its associated device driver). This information needs to be communicated back to the other portion of the CNC control software responsible for requesting the motion control function to complete the function the software is currently undertaking, so that appropriate action, such as displaying a message on the operator CRT, may occur. However, there are usually many other portions of the CNC control system software that will also need to be informed of the hardware fault. Moreover, the portions that need to know about the fault will vary depending on the exact fault. In past systems, the motion control function has been used to keep track of which portions of the CNC control system software must be notified of which hardware faults. This not only places an increased burden on the motion control portion of the CNC control system software, but also makes this portion more difficult to maintain.
Computer programmers writing CNC software have generally designed the entire software system using structured techniques that analyze what the entire CNC machine tool must do (functional decomposition). This has resulted in complex, difficult-to-modify software systems. For example, software code relating to the user interface by which a user describes a part to be machined, can be found in other portions of the CNC control system software, such as the motion controller. One example is that when a motion controller receives a signal from a machine tool indicating a fault condition (for example, when an object in the work area prevents the table from moving to a desired location, or a blown fuse), the motion controller might directly display an error message on the CRT display. Because prior CNC control system software generally is not broken down into portions corresponding to the discrete, physical components of a CNC machine tool, a change in one portion of the software is difficult to make and frequently requires changes to other portions of the software.
Another example illustrating this problem occurs when a user, system integrator or even machine tool manufacturer wishes to add a new hardware component to the machine tool. For example, it may be desirable to replace an AC induction motor with a DC brushless motor from a different manufacturer. The new motor will likely use a different communications protocol and have different tolerance specifications and operating limits. Therefore, the motion control software will need to be modified to be able to communicate with the new motor using its communications protocol. The user interface will also need to be modified so that the user may specify the improved tolerance parameters. However, with past CNC software, these changes will have a ripple effect throughout the entire software system, greatly increasing the time required to develop a new software system capable of using the new motor. Many of the additional revisions are caused by the fact that the data the software needs to access is dispersed throughout the entire software system. For example, to add a new software function, the software may need to know, what tool is presently in the spindle, the speed the spindle is rotating, the coordinates of the axes (location of the table), the readings of a thermal sensor, information about forces being exerted on the cutting spindle, and the stage (or step) of processing the workpiece is currently in. In past CNC systems, this information would likely be diffused throughout various software modules, and the way these data elements interact is either too complex to discern (execpt to the original software author), or proprietary.
These problems with CNC control systems have led to several other problems throughout the industry. There is a long lead time for system integrators or CNC machine tool manufacturers to be able to incorporate new hardware components into existing systems. This problem applies not only to new CNC machine designs, but also to efforts to add improved or additional components to an existing CNC machine tool, or to retrofit an existing machine tool with CNC capabilities. Another problem is that of scalability. Because CNC control software is usually written for use in accordance with an anticipated collection of hardware components, the same software can not be easily adapted for use in connection with other hardware components. In other words, CNC software is generally not "scalable," meaning that the software used to operate sophisticated, high-end CNC machines can not also be used to operate "bare-bones," low-end CNC machine tools. As a result, CNC manufacturers "reinvent" software having the same functionality merely because it designed to work in a CNC having different hardware components.
Programmers for CNC control systems can also be required to "reinvent" software components not just in response to new hardware, but also in response to new standards for inputting descriptions of parts to be formed by the CNC machine. The earliest CNC machines accepted part definitions through punched paper tape. Subsequent CNC machines (such as that disclosed in U.S. Pat. No. 4,477,754) interrogated a machine operator through a series of questions to obtain instructions about how to create a desired part. More recently, several standard data file formats have emerged for describing parts to be machined, such as the HURCO conversational or RS-274D M&G code programs. In the past "part program interpreter" modules of CNC control system programs, each module used for accepting a part definition in a different format, would generally have to access, as described above, various data elements and software routines diffused throughout the CNC control system software. Again, each different input format has resulted in a unique part program interpreter software program, and these programs all include much common, and therefore needlessly duplicative, functionality.